<template>
  <div id="app">
    <router-view />
  </div>
</template>

<script>
import { UserInfo } from "../src/utils/index";
export default {
  methods: {
    getUser() {
      UserInfo();
    }
  },
  created() {
    if (localStorage.getItem("token")) this.getUser();
  },
  mounted() {
    // debugger;
    // 关闭浏览器窗口的时候清空浏览器缓存在localStorage的数据
    // window.onbeforeunload = function(e) {
    //   var storage = window.localStorage;
    //   storage.clear();
    // };
  }
};
</script>

<style lang="scss">
* {
  padding: 0;
  margin: 0;
  list-style: none;
  box-sizing: border-box;
}

html,
body,
#app,
.public {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}
</style>
